Lisp_Object
menu_bar_items ()
{
+ int count = specpdl_ptr - specpdl;
+
/* The number of keymaps we're scanning right now, and the number of
keymaps we have allocated space for. */
int nmaps;
int mapno;
+ /* In order to build the menus, we need to call the keymap
+ accessors. They all call QUIT. But this function is called
+ during redisplay, during which a quit is fatal. So inhibit
+ quitting while building the menus. */
+ specbind (Qinhibit_quit, Qt);
+
/* Build our list of keymaps.
If we recognize a function key and replace its escape sequence in
keybuf with its symbol, or if the sequence starts with a mouse
result = menu_bar_one_keymap (def, result);
}
- return Fnreverse (result);
+ return unbind_to (count, Fnreverse (result));
}
\f
/* Scan one map KEYMAP, accumulating any menu items it defines